package com.chanjiedata.changbs.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chanjiedata.changbs.R;
import com.chanjiedata.changbs.help.GlideHelper;
import com.chanjiedata.changbs.proto.Mystock;

import java.util.List;

/**
 * 文件名 : ProgressAdapter
 * 创建者 : MangoWang
 * 创建日期 : 2019/11/25 11:50
 * 微信 : MangoWaWang
 * 邮箱 : 763482205@qq.com
 * 描述 : TODO
 */

public class MyMachineAdapter extends BaseQuickAdapter<Mystock.myMachine.List, BaseViewHolder> {
    public MyMachineAdapter(Context context, List<Mystock.myMachine.List> dataList) {
        super(R.layout.item_my_machine, dataList);
    }

    @Override
    protected void convert(BaseViewHolder helper, Mystock.myMachine.List item) {
        helper.setText(R.id.tv_good_name, item.getGoodsName())
                .setText(R.id.tv_class, item.getGoodsSerial())
                .setText(R.id.tv_money, "¥" + item.getGoodsPrice())
                .setText(R.id.tv_number, "x" + item.getGoodsCountNum() + "");

        GlideHelper.INSTANCE.loadImage(helper.getView(R.id.iv_good_icon) , item.getGoodsImage());
        helper.addOnClickListener(R.id.tv_fen_run);

//        tvFenRun.setOnClickListener(view -> itemClickListener.onAdapterViewClick(view,tvFenRun.getId(),item.getGoods_id()+""));


    }
}